import { fromJS } from 'immutable'

const initState = {
  per: 'presist'
}

export default function Reducer(preState = initState, action) {
  const { type, data } = action
  const preStateMap = fromJS(preState)
  switch (type) {
    case 'SET_USERINFO':
      return preStateMap.set('userInfo', data).toJS()
    default:
      return preState
  }
}
